// api  接口列表	（路径、参数、loading、是否检验token）
import {
	http
} from '@/service/request/index.js' //请求拦截
import helper from '@/common/helper.js' //静态变量


//登录
export const login = (datas) => {
	let options = {
		baseUrl: helper.baseUrl,
		header: {
			'Content-Type': 'application/json;charset=UTF-8'
		}
	}
	return http._post("/logon/login", datas, true, options);
}

//检查token过期
export const verifyToken = (datas) => {
	return http._post("/logon/verifyToken", datas, false);
}
// 活动角色信息
export const queryUserAllInfo = (datas) => {
	return http._post("/logon/user/queryUserAllInfo", datas, false);
}

//获取验证码
export const getVerificationCode = (datas) => {
	return http._post("/logon/getVerificationCode", datas, false);
}

//获取线索列表
export const getClueList = (datas) => {
	return http._post("/clue/unique/salesman/page", datas, false);
}

// 获取线索详情
export const getClueDetail = (datas) => {
	return http._post("/clue/unique/detail", datas, false);
}
// 消息已读
export const getRead = (datas) => {
	return http._post("/clue/message/read", datas, false);
}

// 修改线索详情
export const salesmanEdit = (datas) => {
	// return http._post("/clue/unique/salesman/edit", datas, false);
	return http._post("/clue/unique/save", datas, false);
}

//重置密码
export const resetPassword = (datas) => {
	let options = {
		baseUrl: helper.baseUrl,
		header: {
			'Content-Type': 'application/json;charset=UTF-8'
		}
	}
	return http._post("/logon/resetPassword", datas, false, options);
}

// 主页图表
export const indexTable = (datas) => {
	return http._post("/clue/unique/salesman/index", datas, false);
}

// 新|待分配
export const getAssign = (datas) => {
	return http._post("/clue/unique/salesman/assign", datas, false);
}

// 人工派发分配
export const uniqueManual = (datas) => {
	return http._post("/clue/unique/manual", datas, false);
}

// 获取销售顾问列表
export const getUserByRoleId = (datas) => {
	return http._post("/logon/role/queryUserByRoleId", datas, false);
}

// 获取渠道列表
export const getChannelTree = (datas) => {
	return http._post("/clue/channel/tree", datas, false);
}

// 选择车型
export const getCarModelStyleName = (datas) => {
	return http._post("/label/carModel/getCarModelStyleName", datas, false);
}

// 新建线索跟进
export const addClueFollow = (datas) => {
	return http._post("/clue/follow/save", datas, false);
}

// 获取主机厂配置
export const getClueRuleOem = (datas) => {
	return http._post("/clue/rule/oem/detail", datas, false);
}
// 跟进历史数据
export const getollowPage = (datas) => {
	return http._post("/clue/follow/page", datas, false);
}
//线索验证
export const getVerify = (datas) => {
	return http._post("/clue/unique/verify", datas, false);
}

// //新建编辑 线索/clue/unique/save  
// export const getSave = (datas) => {
// 	return http._post("/clue/unique/save", datas, false);
// }
// 获取 无效原因
export const getCommonEnums = (datas) => {
	return http._post("/clue/common/enums", datas, false);
}

// 获取首页跟进列表页
export const getFollowList = (datas) => {
	return http._post("/clue/unique/salesman/follow", datas, false);
}

// 弹框：活动列表
export const getAppActivities = (datas) => {
	return http._post("/label/activity/getAppActivities", datas, false);
}

// 获取线索跟进详情
export const getFollowDetail = (datas) => {
	return http._post("/clue/follow/detail", datas, false);
}

//首页 活动  列表
export const getAppIndexActivities = (datas) => {
	return http._post("/label/activity/getAppIndexActivities", datas, false);
}

//活动详情 /label/activity/getActivityInfo
export const getActivityInfo = (datas) => {
	return http._post("/label/activity/getActivityInfo", datas, false);
}


//活动分享记录
export const addActivityShareLog = (datas) => {
	return http._post("/label/activity/addActivityShareLog", datas, false);
}

// 生成二维码
export const getQRImage = (datas) => {
	let options = {
		responseType: 'arraybuffer',
	}
	return http._post("/label/activity/getQRImage", datas, false, options);
}

// 生成二维码(三方平台化)
export const getUnlimitedCode = (datas) => {
	return http._post("/label/open/getUnlimitedCode", datas, false);
}

// 获取归集历史
export const getOriginalPage = (datas) => {
	return http._post("/clue/original/page", datas, false);
}

//销售顾问报表接口
export const getSalesmanOverview = (datas) => {
	return http._post("/report/salesman/overview", datas, false);
}

//店总报表接口
export const overviewByDealerId = (datas) => {
	return http._post("/report/salesGeneral/overviewByDealerId", datas, false);
}

//获取活动详情报表
export const getTotals = (datas) => {
	return http._post("/report/activity/getTotals", datas, false);
}

//获取店总、店销售总活动部分
export const getActivityByDealerId = (datas) => {
	return http._post("/report/salesGeneral/activityByDealerId", datas, false);
}

//获取 大区总活动部分
export const getActivityByAreaId = (datas) => {
	return http._post("/report/salesArea/activityByAreaId", datas, false);
} 

//获取 集团总活动部分
export const getActivityByGroupId = (datas) => {
	return http._post("/report/salesGroup/activityByGroupId", datas, false);
} 

//销售经理报表接口
export const getSalesManagerOverviewByDept = (datas) => {
	return http._post("/report/salesManager/overviewByDept", datas, false);
}


//获取 店总 渠道信息
export const getChannelByDealerId = (datas) => {
	return http._post("/report/salesGeneral/channelByDealerId", datas, false);
} 

//获取 大区总 渠道信息
export const getChannelByAreaId = (datas) => {
	return http._post("/report/salesArea/channelByAreaId", datas, false);
}

//获取 集团总 渠道信息
export const getChannelByGroupId = (datas) => {
	return http._post("/report/salesGroup/channelByGroupId", datas, false);
}

//获取 大区首页
export const overviewByAreaId = (datas) => {
	return http._post("/report/salesArea/overviewByAreaId", datas, false);
}

//获取 集团首页
export const overviewByGroupId = (datas) => {
	return http._post("/report/salesGroup/overviewByGroupId", datas, false);
}

//获取 获取品牌
export const getAddCarMakeTree = (datas) => {
	return http._post("/label/carMake/getAddCarMakeTree", datas, false);
}


// 列表查询条件--销售顾问
export const getCondition = (datas) => {
	return http._post("/clue/unique/condition", datas, false);
}



// /**
//  * 
//  */
// export const getManager = (datas) => {
// 	let options = {
// 		baseUrl: helper.baseUrl,
// 		header: {
// 			'content-type': 'application/x-www-form-urlencoded' // 表单提交
// 		},
// 	}
//     return http._post("/test-drive/manager", datas, false, options);
// }

// 请求使用方式
// import {
// 		checkLogin
// 	} from '@/service/api/api.js';
// let data = {
// 	code: this.optionObj.scene
// }
// checkLogin(data).then(res => { //解码
// 	if (res.data.code == 0) {

// 	}
// }).catch(err => {
// 	console.log(err)
// })
